﻿using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using EZCRS.HCMS.DataAcl;
using System.Collections;
using System.Globalization;
using System.Threading;

namespace EZCRS.HCMS.myajax
{
    /// <summary>
    /// 基类
    /// </summary>
    public class MainBase :System.Web.UI.Page
    {
        //当前登录
        /// <summary>
        /// propertyid
        /// </summary>
        public int BasPropertyId = 0;
        /// <summary>
        /// 酒店编号
        /// </summary>
        public int BasHotelId = 0;//酒店编号
        /// <summary>
        /// 集团编号
        /// </summary>
        public int BasGroupId = 0;//集团编号
        /// <summary>
        /// 管理员名称
        /// </summary>
        public string BasUserName = "admin";//登录用户登录名
        /// <summary>
        /// 管理员id
        /// </summary>
        public int BasUserId = 0;

        /// <summary>
        /// 语言类别
        /// </summary>
        public int LanguageId = 0;
        


      
                
        

        public MainBase()
        {
            string pids = CFun.GetCookies("cms", "p");
            BasGroupId = Convert.ToInt32(CFun.GetCookies("cms", "g"));
            BasHotelId = Convert.ToInt32(CFun.GetCookies("cms", "h"));
            BasPropertyId = Convert.ToInt32((pids!="")?pids:"0");

            string CurrentLanguage = DataAcl.Common.GetCurrentLanguage();

            try
            {
                if (CurrentLanguage == "")
                    CurrentLanguage = "zh-CN";//默认简体中文

                //多语言选择
                //switch (CurrentLanguage)
                //{
                //    case "en-US"://英文
                //        LanguageId = 1;
                //        break;
                //}
            }
            catch (Exception ex) { }




            String selectedLanguage = CurrentLanguage;
            UICulture = selectedLanguage;
            Culture = selectedLanguage;

            Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(selectedLanguage);
            Thread.CurrentThread.CurrentUICulture = new CultureInfo(selectedLanguage);
        }


      
        
      
    }

    
}
